package com.zhao.shiyuanbaoyou.util;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by 张昭 on 2016/10/31.
 */

public class OkHttpUtil {
    private static OkHttpUtil http;

    public static OkHttpUtil getIntecer(){
        if (http==null){
            http =new OkHttpUtil();
        }
        return http;
    }
    public static String run(String path)throws IOException{
        OkHttpClient client=new OkHttpClient();
        Request request=new Request.Builder().url(path).build();
        Call call=client.newCall(request);
        Response response=call.execute();
        return response.body().string();
    }
}
